import { getVideos, getVideoByMId } from '@/api/video'
const state = {
  VideoList: [],
  Videos: []
}
const getters = {

}
const mutations = {
  GETVIDEOS (state, Videos) {
    state.VideoList = Videos
  },
  GETVIDEOBIMId (state, Videos) {
    state.Videos = Videos
  }
}
const actions = {
  async getVideos ({ commit }, data) {
    const result = await getVideos(data.mId, data.videoId)
    commit('GETVIDEOS', result.data)
  },
  async getVideoByMId ({ commit }, mId) {
    const result = await getVideoByMId(mId)
    commit('GETVIDEOBIMId', result.data)
  }
}
export default ({
  namespaced: true,
  state,
  getters,
  mutations,
  actions
})
